package com.example.peibei.ui.adapter;

import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.HomeCateTwo;
import com.dingtao.common.bean.Square;
import com.dingtao.common.util.GlideUtils;
import com.example.peibei.R;

import java.util.List;

public class SquareFollowAdapter extends BaseQuickAdapter<Square.RecordsDTO, BaseViewHolder> {
    public SquareFollowAdapter(@Nullable List<Square.RecordsDTO> data) {
        super(R.layout.item_follow_square, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Square.RecordsDTO item) {
        helper.setText(R.id.tv_cate, item.getCircleName());
        ImageView head = helper.getView(R.id.iv_cate);
        if (!TextUtils.isEmpty(item.getHeaderUrl())) {
            GlideUtils.loadImg(getContext(), item.getHeaderUrl(), 20, head);
        } else {
            helper.setImageResource(R.id.iv_cate, R.mipmap.cate_defalut);
        }
    }
}
